import { config, ConnectionPool } from 'mssql';

export const connectionCfg : config = {
    server    : "localhost",
    database  : "partlib",
    user      : "sa",
    password  : "GJPF4.7PTW4",
    options   : {
        appName  :  "ts4mssql"
    }
}
console.log(987);
async function fun1() {
    const pool = new ConnectionPool(connectionCfg );
    console.log(111);
    pool.connect().then(
        ()=> {
            pool.query("select top 3 * from p_Manufacturer")
                .then(p=>{ console.log(p.recordset) })
            console.log(333);
        } 
    );
    // pool.query("select top 3 * from p_Manufacturer")
    // .then(p=>{ console.log(p.recordset) })
    // .catch((e)=>{})
    // .finally(()=> pool.close());
    //let pool = await sql.connect(config)
}

fun1();